package main

import "fmt"

//回调函数demo
type TypeFunc func(int,int) int

//定义一个计算方法的函数
func Calculate(a,b int,typeFunc TypeFunc) (result int){
	fmt.Println("Calculate Method Called")
	result = typeFunc(a,b)
	return
}

func Add1(a,b int ) int{
	return a+b
}

func main(){
	println(Calculate(1,2,Add1))
}
